<div id="opret_ny_deltager_form" style="display:none;overflow:auto;width:100%;padding:10px;">
<h1>Opret ny deltager</h1>
<?

//$this->load->view("gamemaster/pc_haandtering");
/*echo form_open("exec/file_final_report"); 


echo "<p class='rubrik'><span style='width:100px;'>Brugernavn:</b> ".form_input("username","")."</p>";
echo "<p class='rubrik'><b style='width:100px;'>Fornavn:</b> ".form_input("rollespiller_fornavn","")."</p>";
echo "<p class='rubrik'><b style='width:100px;'>Efternavn:</b> ".form_input("rollespiller_efternavn","")."</p>";
echo "<p class='rubrik'><b style='width:100px;'>Email-adresse:</b> ".form_input("email_adress","")."</p>";
echo "<p>Tildel rolle: Opret ny karakter | giv eksisterende rolle</p>";


echo "<div class='new_player_character'>";
echo "Ny karakter";

echo "</div>";


echo "<div class='eksisting_character'>";
echo "Søg efter en ny karakter";

echo "</div>";


//echo br()."<b>Processen blev afviklet i tidsrummet</b>".br();
//echo form_input("exec_start","dd-mm-åååå tt:MM");
//echo " til ".form_input("exec_slut","dd-mm-åååå tt:MM").br();


echo "<div style='float:right;'>".form_submit("afrapporter","Opret ny deltager")."</div>";
echo form_close();
*/

?>



</div>
<h2 class="rubrik">
Rollespiller
<span style="float:right;">Aktiv</span>
</h2><br>
<?
//print_r($rollespillere_karakterer);

$this->load->library('table');
$tmpl = array ( 'table_open'  => '<table border="0"  class="rubrik">' );
$this->table->set_template($tmpl); 

//$this->table->set_heading(array('<h4>Karakter</h4>', '<h4>Rollespiller</h4>'));
    $check_array = array();

	foreach($rollespillere_karakterer as $r)
	{

            echo "<div>";
            $navn_array = array($r['navn'],$r['efternavn']) ;
            $navn = join(" ",$navn_array); 



            if(!in_array($navn,$check_array)) {

                echo "<div style='float:right;'>";
                    if($r['aktiv'] == 0) {
                     echo anchor("admin/aktiver/".$r['id_rollespiller']," ","class='passiv'");

                    }
                    else {
                     echo anchor("admin/deaktiver/".$r['id_rollespiller']," ","class='aktiv'");

                    }

                echo "</div>";


                echo "<h3 class='rubrik user_character_link' id='".$r['id_rollespiller']."'>".$navn."</h3>";

				echo "<p class='user_characters".$r['id_rollespiller']."' style='display:none;padding:10px;border:1px solid #B7937B;'>";
				echo "<b class='rubrik'>Spiller rollen som:</b><br/>";
                //echo "<p class='rubrik' id='".$r['id_rollespiller']."' style=''>";
						
                 	foreach($rollespillere_karakterer as $s)
	                {



                        $navn_array2 = array($s['navn'],$s['efternavn']) ;
                        $navn2 = join(" ",$navn_array2); 

                        if($navn == $navn2) {

							echo "<span class='rubrik' style='float:right;' >Level ".$s['level']." ".$s['profession']."</span>";
	

							echo anchor("almanak/side/".$s['id_karakter'],$s['karakter'],"class='ink'").br();
                        }   


                    }
                echo "</p>";
         


                echo br();
            }

            echo "</div>";
            $check_array[] = $navn;

	}


?>


<script type="text/javascript">
//$(document).ready(function() {

$(".user_character_link").click(function() {
	var id = $(this).attr('id');
	//alert(id);
	$(".user_characters" + id).slideToggle("fast");

});

$("#opret_ny_deltager_link").click(function() {
	$("#opret_ny_deltager_form").slideToggle("fast");

});



//});
</script>

